﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Modules.zoo {
    import Events.*;
    import Classes.*;
    import Classes.util.*;
    import Classes.effects.*;
    import Classes.LogicComponents.*;

    public class MunicipalComponentZoo extends MunicipalComponentBase {

        public static const DATA_SOURCE_TYPE:String = "giftSenders";

        public function MunicipalComponentZoo(_arg1:Municipal){
            super(_arg1);
            m_municipal.addEventListener(GenericObjectEvent.MECHANIC_DATA_CHANGED, this.onMechanicDataChanged, false, 0, true);
        }
        protected function onMechanicDataChanged(_arg1:GenericObjectEvent):void{
            if (_arg1.obj == DATA_SOURCE_TYPE){
                m_municipal.updateStagePickEffect();
            };
        }
        override public function enableUpdateArrow():Boolean{
            return (((((!(Global.isVisiting())) && (((this.checkDataExists()) || (this.canPostFeed()))))) || (super.enableUpdateArrow())));
        }
        override public function createStagePickEffect():void{
            if (((!(Global.isVisiting())) && (isHarvestable()))){
                super.createStagePickEffect();
            } else {
                createStagePickEffectHelper(StagePickEffect.PICK_EXCLAMATION);
            };
        }
        protected function checkDataExists():Boolean{
            var _local1:Object = m_municipal.getDataForMechanic(DATA_SOURCE_TYPE);
            if (((_local1) && ((GameUtil.countObjectLength(_local1) > 0)))){
                return (true);
            };
            return (false);
        }
        protected function canPostFeed():Boolean{
            return (Global.world.viralMgr.canPost(m_municipal.getItem().feed));
        }

    }
}//package Modules.zoo 
